package com.dotflat.xj.repository;

import com.dotflat.xj.domain.Data;
import com.dotflat.xj.po.DataPO;
import com.matt.domain.Classes;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DataRepository extends JpaRepository<Data, String>, JpaSpecificationExecutor<Data> {

   @Query(value = "SELECT d.* from xj_data d  where d.type = ?1 and d.areaId =?2  ",nativeQuery = true)
   List<Data> typeByData(String type,String areaId);


   List<Data> findAllByType(String type);


   List<Data> findAllByTypeAndAreaIdAndLabel(String type,String areaId,String label);

   List<Data> findAllByTypeAndVal( String type,String val);

   List<Data> findAllByTypeAndAreaId(String type,String areaId);
}
